#ifndef __RENDERABLE__
#define __RENDERABLE__

#include <GLSL.hh>

#include <vector>
#include <ode/ode.h>
#include <SDL/SDL.h>



extern "C" {
#include <libmd3/structure.h>
#include <libmd3/loader.h>
#include <libmd3/mesh.h>
#include <libmd3/convert.h>
}

#include <stdlib.h>
#include <string.h>

#include <math.h>


#include <GL/gl.h>

using namespace std;

struct Point{
  double x,y,z;
};

class Renderable{
 
 public:
  Renderable();
  Renderable(const std::string& name, double x, double y, double z, const char* md3file);
    
  Renderable& operator=(const Renderable& r);

  ~Renderable();
  
  void Render();
  
  double GetPosX();
  double GetPosY();
  double GetPosZ();

  Point GetPos();

  void SetName(std::string& name);
  const std::string GetName();
  void SetPos(double x, double y, double z);
    
  static GLuint LoadGLTexture(const char* filename);
  static SDL_Surface* LoadBMP(const char* filename);
  static void draw_one_mesh(libmd3_mesh* mesh);
  void draw_md3_file();
  libmd3_file* GetModel();

  void LoadAllTextures();



 private:
  double mX;
  double mY;
  double mZ;

  double mRotX;
  double mRotY;
  double mRotZ;

  string mName;

  libmd3_file* mMd3model;
   
  int nextFrame;


};

#endif
